This page provides two simple examples of View.h++ code. From here you can also access:
XmString delMsg, button1, filename: delMsg = XmStringCreateSimple ("Delete"); filename = XmStringCreateSimple ("workfile"); button1 = XmStringConcat (delMsg, filename);
RWXmString delMsg ("Delete"), filename ("workfile"), button1; button1 = delMsg + filename; // Using + to concatenate
The legendary "Hello World" example, done with View.h++
class DemoView : public RWMainView public: DemoView (unsigned argc, char* argv [ ] ) : RWMainView (argc, argv) { RW Menu *menu = new RWMenu; menu->addOption ("Go", 'G', this, RWMethod (&DemoView::sayHello)); menu->addSeparator ( ); menu->addOption ("Quit", 'Q', this RWMethod (&DemoView::shutdown)); menu->attachTo (*menuBar, "File", 'F'); } protected: void sayHello ( ) { writeTextAt ("Hello World!", 100, 30); } void shutdown ( ) { exit (0); } }; int main (unsigned argc, char* argv [ ] ) { DemoView view (argc, argv); view.start ( ); return 0; }